<!DOCTYPE html>
<html lang="zh_CN">
<title>HteOS - 登录</title>
<meta charset="UTF-8"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,userVo-scalable=no">
<link href="https://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" src="http://qzonestyle.gtimg.cn/qzone/openapi/qc_loader.js" data-appid="101095186"
        data-redirecturi="http://demo.hteos.com/qq_login.html" charset="utf-8"></script>
<!--[if lt IE 9]>
<script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<script src="https://cdn.bootcss.com/html5shiv/3.7.1/html5shiv.min.js"></script>
<![endif]-->
<meta property="qc:admins" content="3040027365760457363757477166230"/>
<style type="text/css">
    body {
        font-family: 'Microsoft YaHei', 'Helvetica Neue', 'Luxi Sans',
        'DejaVu Sans', Tahoma, 'Hiragino Sans GB', STHeiti;
        margin: 0px;
    }

    .navbar-brand > a {
        text-decoration: none;
    }

    .vertical-offset-100 {
        padding-top: 120px;
    }

    .form-signin {
        width: 300px;
        margin: 0 auto;
    }

    .form-signin a {
        text-decoration: none;
    }

    .form-signin a:hover {
        color: #ccc;
    }

    .form-signin .form-signin-heading, .form-signin
    .checkbox {
        margin-bottom: 10px;
    }

    .form-signin .checkbox {
        font-weight: normal;
    }

    .form-signin .form-control {
        position: relative;
        height: auto;
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
    }

    .form-signin .form-control :focus {
        z-index: 2;
    }

    .form-signin input [type="text"] {
        border-radius: 0;
    }

    .form-signin input [type="password"] {
        border-radius: 0;
    }

    .need-help {
        margin-top: 10px;
    }

    .new-user {
        display: block;
        margin-top: 10px;
    }

    .userVo-face {
        text-align: center;
    }
</style>
<script src="https://cdn.bootcss.com/jquery/1.9.1/jquery.min.js"></script>
</head>
<body>
<div class="container">
    <div class="row vertical-offset-100">
        <div class="col-sm-12 col-xs-12 col-md-12" style="text-align: center;color: #fff;">
            <form class="form-signin" action="/login" method="post">
                <div class="userVo-face">
                    <img id="face" src="images/face_180.png" alt="">
                </div>
                <br>
                <h4 style="color:#333">
                    正在使用QQ登录，请稍候....
                </h4>
                <br/>
                <div>
                    <img src="images/preloader_black.gif" style="width: 32px;"/>
                </div>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript">

    QC.Login.getMe(function (id, accessToken) {
        QC.api("get_user_info").success(function (result) {
            $("#face").attr("src", result.data.figureurl_qq_2);
            var data = {};
            data.face = result.data.figureurl_qq_2;
            data.nickName = result.data.nickname;
            data.gender = result.data.gender;
            data.qqOpenId = id;
            register(data);
        });
    });

    function register(data) {
        var xhr = $.post('http://demo.app.hteos.com/registerByQQ', data)
        xhr.success(function (data) {
            console.log(data);
            if (data.success) {
                window.setTimeout(function () {
                    parent.location.reload();
                },10)
                return false;
            }
        });
        xhr.error(function () {
            alert("登录失败，请稍候再试");
        });
    }
</script>
</body>
</html>
